package com.webchat.user.repository.dao;

import com.webchat.user.repository.entity.ApplicationEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface IApplicationDAO extends JpaSpecificationExecutor<ApplicationEntity>,
        JpaRepository<ApplicationEntity, Long> {


    ApplicationEntity findAllByAccessKey(String accessKey);

    Page<ApplicationEntity> findAllByStatusIn(List<Integer> statusList, Pageable pageable);

    Page<ApplicationEntity> findAllByNameLikeAndStatusIn(String appName, List<Integer> statusList, Pageable pageable);
}